<template>
  <div>
    <el-container>
      <el-header class="header" height="4rem">
        <h1 class="header-title">后台监控数据中心</h1>
      </el-header>

      <el-container>
        <el-menu
          :default-active="$route.path"
          :router="true"
          background-color="#545c64"
          text-color="#fff"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          :collapse="isCollapse"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span slot="title">用户管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/admin/role.html">用户角色管理</el-menu-item>
              <!-- <el-menu-item index="/admin/user.html">用户权限管理</el-menu-item> -->
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-menu"></i>
              <span slot="title">其他管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/admin/school.html">学校管理</el-menu-item>
              <el-menu-item index="/admin/patriarchRead.html">家长必读管理</el-menu-item>
              <el-menu-item index="/admin/user.html"
                >用户管理</el-menu-item
              >
              <el-menu-item index="/admin/product.html">管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          
          <el-menu-item index="/admin/junior-high.html"
            ><template slot="title">
              <i class="el-icon-menu"></i>
              <span slot="title">县区管理</span>
            </template></el-menu-item
          >
        </el-menu>

        <el-main class="main">
          <transition name="el-zoom-in-top" mode="out-in">
            <router-view></router-view>
          </transition>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "WebTestAdmin",

  data() {
    return {
      isCollapse: false,
    };
  },

  mounted() {},

  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 250px;
  min-height: calc(100vh - 4rem);
}
.header {
  background-color: #111;
  color: #fff;
  display: grid;
  grid-template-columns: 0.5fr 2fr 1fr;
  border-bottom: 0px;
}
.hearder-right {
  display: flex;
  justify-content: right; /*x对齐*/
  align-items: center; /*y对齐*/
}
.header > div > a {
  color: #fff;
  text-decoration: none;
  margin: 1rem;
}
.header-title {
  font-size: 1.3rem;
  line-height: 4rem;
  margin: 0;
}

.main {
  height: calc(100vh - 6rem);
  height: calc(100vh - 7rem);
  overflow: auto;
}
</style>